import { isAuth } from '@/utils/storage'
import { ReactNode } from 'react'
import { Navigate } from 'react-router-dom'

const AuthRoute: React.FC<{ children: ReactNode }> = ({ children }) => {
  if (isAuth()) {
    return <>{children}</>
  } else {
    return <Navigate to="/login" replace />
  }
}

export default AuthRoute